#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e5 + 5;

int n, m, u, v, t, d;
int s[N];
queue<int> a, b, c;
vector<int> ans;
void push(int x, int t) {
  x += d * (t - 1);
  ans.push_back(x);
  int y = 1ll * x * u / v;
  int z = x - y;
  y -= d * t;
  z -= d * t;
  b.push(y), c.push(z);
}
int top() {
  int x = a.size() ? a.front() : -1e9;
  int y = b.size() ? b.front() : -1e9;
  int z = c.size() ? c.front() : -1e9;
  return max({x, y, z});
}
void pop(int x) {
  if (a.size() && a.front() == x) {
    a.pop();
    return;
  }
  if (b.size() && b.front() == x) {
    b.pop();
    return;
  }
  if (c.size() && c.front() == x) {
    c.pop();
    return;
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> d >> u >> v >> t;
  rep(i, 1, n) cin >> s[i];
  sort(s + 1, s + n + 1);
  per(i, n, 1) a.push(s[i]);
  rep(i, 1, m) {
    int x = top();
    pop(x);
    push(x, i);
  }
  rep(i, 1, m) {
    int x = ans[i - 1];
    if (i % t == 0) cout << x << ' ';
  }
  cout << endl;
  rep(i, 1, n + m) {
    int x = top();
    pop(x);
    x += m * d;
    if (i % t == 0) cout << x << ' ';
  }
  return 0;
}